//
//  WKLabel.m
//  V-Learn
//
//  Created by Apple on 2019/1/24.
//  Copyright © 2019 yxk. All rights reserved.
//

#import "WKLabel.h"

@implementation WKLabel

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
        self.textAlignment = NSTextAlignmentCenter;
        self.font = [UIFont systemFontOfSize:16];
        self.scale = 0.0;
        
    }
    return self;
}

/** 通过scale的改变改变多种参数 */
- (void)setScale:(CGFloat)scale
{
    _scale = scale;
    
    CGFloat selected_r = 34;
    CGFloat selected_g = 143;
    CGFloat selected_b = 254;
    
    CGFloat normal_r = 59;
    CGFloat normal_g = 59;
    CGFloat normal_b = 59;
    
    //    self.textColor = [UIColor blackColor];
    self.textColor = [UIColor orangeColor];//[UIColor colorWithHex:0x333333];//[UIColor colorWithRed:(normal_r + scale * (selected_r - normal_r))/255.f green:(normal_g + scale * (selected_g - normal_g))/255.f blue:(normal_b + scale * (selected_b - normal_b))/255.f alpha:1];
    
    CGFloat minScale = 14/16.f;
    CGFloat trueScale = minScale + (1-minScale)*scale;
    //    self.transform = CGAffineTransformMakeScale(trueScale, trueScale);
}


@end
